Offline Storage

  • MGLOfflineStorage implements a singleton (shared object) that manages offline packs. All of this class’s instance methods are asynchronous, reflecting the fact that offline resources are stored in a database.

    See more

    Declaration

    Objective-C

    @interface MGLOfflineStorage : NSObject
  • A block to be called once an offline pack has been completely created and added.

    Declaration

    Objective-C

    typedef void (^MGLOfflinePackAdditionCompletionHandler)(
        MGLOfflinePack *_Nullable, NSError *_Nullable)

    Parameters

    pack

    Contains a pointer to the newly added pack, or nil if there was an error creating or adding the pack.

    error

    Contains a pointer to an error object (if any) indicating why the pack could not be created or added. For a list of possible error codes, see MGLErrorCode.

  • A block to be called with a complete list of offline packs.

    Declaration

    Objective-C

    typedef void (^MGLOfflinePackListingCompletionHandler)(
        NSArray<MGLOfflinePack *> *_Nonnull, NSError *_Nullable)

    Parameters

    pack

    Contains a pointer an array of packs, or nil if there was an error obtaining the packs.

    error

    Contains a pointer to an error object (if any) indicating why the list of packs could not be obtained.

  • A block to be called once an offline pack has been completely invalidated and removed.

    Declaration

    Objective-C

    typedef void (^MGLOfflinePackRemovalCompletionHandler)(NSError *_Nullable)

    Parameters

    error

    Contains a pointer to an error object (if any) indicating why the pack could not be invalidated or removed.

  • An MGLOfflinePack represents a collection of resources necessary for viewing a region offline to a local database. It provides an optional MGLOfflinePackDelegate object with progress updates as data or errors arrive from the server.

    See more

    Declaration

    Objective-C

    @interface MGLOfflinePack : NSObject
  • The MGLOfflinePackDelegate protocol defines methods that a delegate of an MGLOfflinePack object can optionally implement to be notified of any changes in the pack’s download progress and of any errors while downloading.

    See more

    Declaration

    Objective-C

    @protocol MGLOfflinePackDelegate <NSObject>
  • A structure containing information about an offline pack’s current download progress.

    See more

    Declaration

    Objective-C

    struct MGLOfflinePackProgress {}
  • The state an offline pack is currently in.

    See more

    Declaration

    Objective-C

    enum MGLOfflinePackState : NSInteger {}